package com.gu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gu.entity.CrmBanner;
import com.gu.mapper.CrmBannerMapper;
import com.gu.service.AdminBannerService;
import org.springframework.stereotype.Service;

/**
 * Description:
 *
 * @Autor: Rolin
 * datetime: 05-30-23:05
 */
@Service
public class AdminBannerServiceImpl extends ServiceImpl<CrmBannerMapper, CrmBanner> implements AdminBannerService {


    @Override
    public Page<CrmBanner> getBannersByPage(Long current, Long limit) {
        Page<CrmBanner> bannerPage = new Page<>(current,10);
        QueryWrapper<CrmBanner> Wrapper = new QueryWrapper<>();
        Wrapper.orderByDesc("sort");
        Page<CrmBanner> pageParams = this.page(bannerPage, Wrapper);
        return pageParams;
    }
}
